Fix LCAO Hermitian matrix handling and EXX little-group density restoration - #7923
Merged
mohanchen merged 9 commits intoSep 14, 2026
Conversation
Project multi-k density matrices before star restoration to preserve the symmetry assumed by reduced EXX contractions. Add complex-density and spin-channel regressions and update the Si HSE reference after independent solver and full-contraction checks.
dyzheng
approved these changes
Sep 8, 2026
mohanchen
reviewed
Sep 8, 2026
mohanchen
left a comment
Collaborator
There was a problem hiding this comment.
I will handle this PR later.
7 tasks
Fisherd99
pushed a commit
to Fisherd99/abacus-BSE
that referenced
this pull request
Sep 22, 2026
…ration (deepmodeling#7923) * fix(hsolver): honor Hermitian upper triangles in native ELPA and cuSolver * fix(hsolver): honor Hermitian upper triangle in genelpa (cherry picked from commit e27ef66) * Fix second generalized ELPA transform (cherry picked from commit 53208bf) * fix(test): allocate the advertised LAPACK workspace * fix(exx): average irreducible densities over the little group Project multi-k density matrices before star restoration to preserve the symmetry assumed by reduced EXX contractions. Add complex-density and spin-channel regressions and update the Si HSE reference after independent solver and full-contraction checks. * docs: synchronize EXX symmetry description with parameter source --------- Co-authored-by: Chen Chengbing <1747193328@qq.com> Co-authored-by: TaoXia <taoxia@mail.ustc.edu.cn> Co-authored-by: Mohan Chen <mohanchen@pku.edu.cn> Co-authored-by: TRAE CLI <traecli@bytedance.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
Related to #7914. This PR corrects authoritative-upper-triangle handling in the separate native ELPA and cuSolver implementations, and fixes an EXX little-group density-restoration issue exposed by enforcing that matrix contract. No separate issue is required.
The
genelpatransform and fallback corrections from #7914 are now included through upstream develop, with TaoXia's original attribution preserved. They are no longer a pending dependency.Unit Tests and/or Case Tests for my changes
Commands run
For the fresh six-way experiment, each diagnostic variant was rebuilt from commit
75ee7493a, then run in a separate case directory:The experiment crosses two controlled factors:
The old-transform control changes only the Cholesky-branch
hemm('L','U',A,B)operation back togemm('C','N',A,B)on the same current baseline. It does not revert the whole repository. All recorded ELPA decomposition states were1; the fallback branch was not exercised in this experiment.Both ELPA controls use the same diagnostic one-stage setting to avoid the previously observed installed two-stage library failure. This setting is not part of the production changes in the PR.
Result summary
All six calculations completed successfully on 2026-09-14.
Without averaging, the maximum solver-dependent energy difference is 2.678 meV, while corrected PZHEMM and ScaLAPACK agree within
1.073e-9 eV.After little-group averaging, all three paths agree within
5.33305e-10 eV, including the old PZGEMM control. They also give the same force absolute sum (0.000000 eV/Å) and stress absolute sum (2143.792554 kbar) at the output precision.Matrix diagnostics were collected at the common solver entry point: 57 solves per case, 342 complete H/S and eigenpair records in total.
The raw matrix norms use ABACUS's internal matrix units. The normalized residual is
Here,$E$ is the diagonal matrix of computed eigenvalues, $H$ is the original full Hamiltonian, and $S_{U}$ is reconstructed from the authoritative upper triangle of $S$ .
Independent NumPy Cholesky/eigvalsh calculations give eigenvalue disagreements no larger than
4.885e-15in internal energy units after averaging.Without averaging, corrected PZHEMM and ScaLAPACK solve the upper-triangle-completed Hermitian problem with residuals below
3.020e-16, but their residuals against the original full H are approximately3.511e-4. After averaging, both the upper-triangle contract and the full-matrix eigenproblem are satisfied at roundoff.Matched conditions and provenance:
75ee7493a.v3.11.0-beta9.tests/08_EXX/08_KP_HSE_symm, preserving its SCF/EXX thresholds and three EXX outer updates.#SCF IS CONVERGED#, final energy, and normal termination records.The retained focused regression coverage includes:
Checks not run, with reason
What's changed?
This PR fixes two related correctness issues: Hermitian matrix input handling in native ELPA/cuSolver, and missing unitary little-group averaging before EXX k-star restoration.
1. Respect the authoritative upper triangles of H and S
For the generalized Hermitian eigenproblem,
LCAO supplies authoritative upper triangles of H/S. A solver must not depend on stale or unspecified lower-triangle entries.
The changes:
genelpaHermitian-transform and fallback corrections.2. Average the IBZ density over its little group before star expansion
A k-star stores one representative operation for each distinct k point. It does not contain every operation fixing the irreducible k point modulo a reciprocal lattice vector.
Define the unitary little group as
The density must first be projected onto the invariant subspace:
In ABACUS's transposed density storage convention,
where$M_{g}$ is the AO rotation matrix in the code's convention.
This group average preserves Hermiticity, is idempotent, and makes the density invariant under little-group operations. Operations reaching the same star member differ by a little-group operation, so averaging removes dependence on the selected representative.
The implementation collects the required unitary little-group operations and AO rotations, averages the IBZ density, and then performs the existing star expansion. The existing star-size weight is applied separately after averaging. Identity-only little groups bypass the additional averaging work.
A single valid rotation preserves Hermiticity. The missing average instead leaves the density inconsistent with the symmetry relations assumed by reduced EXX contractions, which can produce a non-Hermitian Hamiltonian.
The six-way experiment demonstrates the consequence directly: little-group averaging removes the solver-dependent energy split and restores the full Hamiltonian's Hermiticity and eigenproblem residuals to roundoff. Matching the historical reference energy alone would not establish correctness.
The HSE reference and explanatory README are updated using independently checked results. The original case inputs and tolerances are retained.
Governance Notes
docs/parameters.yaml, anddocs/advanced/input_files/input-main.md. The HSE reference and README document the corrected behavior.gga_gradfunctionality is introduced.genelpacorrections retain their original attribution. The native ELPA/cuSolver corrections, regression-helper changes, and EXX little-group restoration fix are included in this PR.